<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>serialize - An output module that uses a simple JSON object to serialize the output.</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<ul>

		<li><a href="#get_version"><code>get_version</code></a></li>
		<ul>

			<li><a href="#returns_">Returns:</a></li>
			<ul>

				<li><a href="#a_version_number_of_the_module_">A version number of the module.</a></li>
			</ul>

		</ul>

		<li><a href="#new"><code>new</code></a></li>
		<li><a href="#get_description"><code>get_description</code></a></li>
		<ul>

			<li><a href="#returns_">Returns:</a></li>
			<ul>

				<li><a href="#a_string_containing_a_description_of_the_format_file_s_functionality_">A string containing a description of the format file's functionality.</a></li>
			</ul>

		</ul>

		<li><a href="#print_header"><code>print_header</code></a></li>
		<ul>

			<li><a href="#returns_">Returns:</a></li>
			<ul>

				<li><a href="#returns_1_if_successful__which_this_sub_routine_always_does__">Returns 1 if successful (which this sub routine always does).</a></li>
			</ul>

		</ul>

		<li><a href="#get_footer"><code>get_footer</code></a></li>
		<ul>

			<li><a href="#returns_">Returns:</a></li>
			<ul>

				<li><a href="#0_if_no_footer_is_there__otherwise_a_string_cointaining_the_footer_">0 if no footer is there, otherwise a string cointaining the footer.</a></li>
			</ul>

		</ul>

		<li><a href="#_print_footer_">&lt;print_footer&gt;</a></li>
		<ul>

			<li><a href="#returns_">Returns:</a></li>
			<ul>

				<li><a href="#a_1_indicating_a_success_">A 1 indicating a success.</a></li>
			</ul>

		</ul>

		<li><a href="#print_line"><code>print_line</code></a></li>
		<ul>

			<li><a href="#args_">Args:</a></li>
			<ul>

				<li><a href="#t_line__a_timestamp_object__which_is_a_reference_to_a_hash_that_stores_all_the_event_information_">t_line: A timestamp object, which is a reference to a hash that stores all the event information.</a></li>
			</ul>

		</ul>

		<li><a href="#_copy_hash"><code>_copy_hash</code></a></li>
		<ul>

			<li><a href="#args_">Args:</a></li>
			<ul>

				<li><a href="#t_line__a_timestamp_object_that_should_be_copied_to_a_new_value__this_is_a_reference">t_line: A timestamp object that should be copied to a new value. This is a reference</a></li>
			</ul>

			<li><a href="#returns_">Returns:</a></li>
			<ul>

				<li><a href="#a_copy_of_the_hash__or_a_reference_to_that_hash__which_is_an_exact_replica_of_the">A copy of the hash, or a reference to that hash, which is an exact replica of the</a></li>
			</ul>

		</ul>

		<li><a href="#get_help"><code>get_help</code></a></li>
		<ul>

			<li><a href="#returns_">Returns:</a></li>
			<ul>

				<li><a href="#a_string_containing_a_help_file_for_this_format_file">A string containing a help file for this format file</a></li>
			</ul>

		</ul>

	</ul>

	<li><a href="#see_also">SEE ALSO</a></li>
</ul>

<hr name="index" />
</div>
<!-- INDEX END -->

<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p>serialize - An output module that uses a simple JSON object to serialize the output.</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This output module of <strong>log2timeline</strong> takes the t_line timesetamp object and serializes
it into a JSON object.</p>
<p>This makes the timestamp object saved in a 'native' object that can be loaded up
by the tool and simple filtering done on the object itself.</p>
<p>
</p>
<h2><a name="get_version"><code>get_version</code></a></h2>
<p>A simple subroutine that returns the version number of the format file</p>
<p>
</p>
<h3><a name="returns_">Returns:</a></h3>
<p>
</p>
<h4><a name="a_version_number_of_the_module_">A version number of the module.</a></h4>
<p>
</p>
<h2><a name="new"><code>new</code></a></h2>
<p>A simple constructor of the output module. Takes care of parsing
parameters sent to the output module</p>
<p>
</p>
<h2><a name="get_description"><code>get_description</code></a></h2>
<p>A simple subroutine that returns a string containing a description of
the funcionality of the format file. This string is used when a list of
all available format files is printed out</p>
<p>
</p>
<h3><a name="returns_">Returns:</a></h3>
<p>
</p>
<h4><a name="a_string_containing_a_description_of_the_format_file_s_functionality_">A string containing a description of the format file's functionality.</a></h4>
<p>
</p>
<h2><a name="print_header"><code>print_header</code></a></h2>
<p>A simple sub routine that prints out a header. Since this serialied object
does not require any header information this sub routine does not really
do anything.</p>
<p>
</p>
<h3><a name="returns_">Returns:</a></h3>
<p>
</p>
<h4><a name="returns_1_if_successful__which_this_sub_routine_always_does__">Returns 1 if successful (which this sub routine always does).</a></h4>
<p>
</p>
<h2><a name="get_footer"><code>get_footer</code></a></h2>
<p>This simple sub routine is called to get a footer of the format. This is
done so that modules can append data to the output if wanted.</p>
<p>However, since this sub routine does not contain any footer it will
not return anym, insteead it returns a 0, indicating there is no footer to
be found.</p>
<p>
</p>
<h3><a name="returns_">Returns:</a></h3>
<p>
</p>
<h4><a name="0_if_no_footer_is_there__otherwise_a_string_cointaining_the_footer_">0 if no footer is there, otherwise a string cointaining the footer.</a></h4>
<p>
</p>
<h2><a name="_print_footer_">&lt;print_footer&gt;</a></h2>
<p>A simple sub routine that is called after all lines have been printed, this is
called so that the module can print a footer.</p>
<p>Since this module does not contain any footer it simply returns straight away.</p>
<p>
</p>
<h3><a name="returns_">Returns:</a></h3>
<p>
</p>
<h4><a name="a_1_indicating_a_success_">A 1 indicating a success.</a></h4>
<p>
</p>
<h2><a name="print_line"><code>print_line</code></a></h2>
<p>This routine gets sent a t_line or a timestamp object and stores it in a serialized
JSON object.</p>
<p>To make it easier to sort and do other filtering the output module splits up the timestamp
object into one object per timesstamp.</p>
<p>This increases space taken on hard drive, yet at the same time makes output processing
and sorting simpler.</p>
<p>
</p>
<h3><a name="args_">Args:</a></h3>
<p>
</p>
<h4><a name="t_line__a_timestamp_object__which_is_a_reference_to_a_hash_that_stores_all_the_event_information_">t_line: A timestamp object, which is a reference to a hash that stores all the event information.</a></h4>
<p>
</p>
<h2><a name="_copy_hash"><code>_copy_hash</code></a></h2>
<p>This sub routine is created to strip the timestamp out of a timestamp object.</p>
<p>Since we would like to serialize the timestamp as a single timestamp per entry, instead of
the default behaviour of possibly storing up to 8 timestamps, this routine copies the
timestamp object into a new reference to a hash, leaving the timestamps not copied.</p>
<p>That way the main routine can spawn copies of that new timestamp object and save
the values of all the timestamps stored in the original one, thus creating a single
timestamp object per timestamp.</p>
<p>
</p>
<h3><a name="args_">Args:</a></h3>
<p>
</p>
<h4><a name="t_line__a_timestamp_object_that_should_be_copied_to_a_new_value__this_is_a_reference_to_a_hash_">t_line: A timestamp object that should be copied to a new value. This is a reference
to a hash.</a></h4>
<p>
</p>
<h3><a name="returns_">Returns:</a></h3>
<p>
</p>
<h4><a name="a_copy_of_the_hash__or_a_reference_to_that_hash__which_is_an_exact_replica_of_the_original_timestamp_object_without_the_timestamps_associated_to_it_">A copy of the hash, or a reference to that hash, which is an exact replica of the
original timestamp object without the timestamps associated to it.</a></h4>
<p>
</p>
<h2><a name="get_help"><code>get_help</code></a></h2>
<p>A simple subroutine that returns a string containing the help
message for this particular output module.</p>
<p>
</p>
<h3><a name="returns_">Returns:</a></h3>
<p>
</p>
<h4><a name="a_string_containing_a_help_file_for_this_format_file__cut_sub_get_help_____return_this_output_module_takes_the_timestamp_object_and_simply_serializes_it_using_the_json__xs_module__so_the_timestamp_object_can_be_read_again_later_for_processing_i">A string containing a help file for this format file
=cut
sub <code>get_help()</code> {
    return
      &quot;This output module takes the timestamp object and simply serializes
it using the JSON::XS module, so the timestamp object can be read again
later for processing.i</a></h4>
<p>The module splits the timestamp object into a single object per timestamp to
make filtering and sorting easier in the post-processing.&quot;;
}</p>
<p>1;</p>
<p>__END__</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>log2timeline</em> 
<em>Log2Timeline</em></p>

</body>

</html>
